#ifndef __VCD_HEARTBEAT_H__
#define __VCD_HEARTBEAT_H__

#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
#include "vcd-util.h"

typedef struct HeartBeatData{

    //type
    HeartbeatType type;

    //connect heartbeat
    char protocol[10];
    char vmid[10];
    char vmnode[50];
    char vmname[100];
    char username[100];
    char instance_id[50];

    //localmode heartbeat
    char pve_id[50];
    char pve_version[16];
    char client_version[16];
    char hostname[32];
    char pve_full_token[32];
    char pve_wsagent_token[50];
}HbData;

typedef struct HeartBeat{
    char host_ip[50];
    char port[50];
    char local_ip[50];
    char platform[15];
    HbData hb_data;
    GThread *heartbeat_thread;
    GMutex* thd_mutex;
    GCond*  thd_cond;
}SendHeartBeat;

void destroy_heartbeat();
void tell_gateway_client_disconnect();
void start_heartbeat(spice_connect_data* scd);
void start_localmode_heartbeat();
void change_heartbeat_host(const char* host);

#endif

